package com.framework.core.api.feign.factory;

import com.framework.core.api.feign.RemoteCustomService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/12 13:59
 * @since JDK 1.8
 */
@Slf4j
@Component
public class RemoteCustomFallbackFactory implements FallbackFactory<RemoteCustomService> {

    @Override
    public RemoteCustomService create(Throwable throwable) {
        log.error(throwable.getMessage());
        return new RemoteCustomService() {

        };
    }
}
